#include <stdio.h>
#include <unistd.h>
#include <string.h>
int g_val=10000;
int main(){
  printf("I am father process,pid:%d,ppid:%d,g_val:%d\n",getpid(),getppid(),g_val);
  sleep(5);

  pid_t id=fork();
  if(id==0)
  {
    //child
    while(1){

      printf("I am child process,pid:%d,ppid:%d,g_val:%d\n",getpid(),getppid(),g_val);
      sleep(1);
    
    }
  }
  else{
    while(1){
    //fa
      printf("I am father process,pid:%d,ppid:%d,g_val:%d\n",getpid(),getppid(),g_val);
      sleep(1);
    }
  }
}

